package com.lantosec.hmrp.modules.supplier.entity;

import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.supplier.vo.SupplierEntryVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 供应商准入信息 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupplierEntry extends BaseEntity<SupplierEntryVO> {

    private static final long serialVersionUID = 1L;
    public SupplierEntry(SupplierEntryVO vo){
        this.entryId = vo.getEntryId();
        this.supplierCode = vo.getSupplierCode();
        this.supplierType = vo.getSupplierType();
        this.validityEndDate = vo.getValidityEndDate();
        this.entryState = vo.getEntryState();
        this.applyTime = vo.getApplyTime();
        this.applyUserId = vo.getApplyUserId();
        this.applyUser = vo.getApplyUser();
        this.entryTime = vo.getEntryTime();
        this.stopFlag = vo.getStopFlag();
    }

    @Override
    public SupplierEntryVO convertToVO(){
        return new SupplierEntryVO(this);
    }


    /**
     * 供应商准入ID
     */
    @TableId(value = "entry_id", type = IdType.ASSIGN_UUID)
    private String entryId;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 准入供应商类型，字典表ID
     */
    private String supplierType;

    /**
     * 有效期结束日期（yyyy-MM-dd）
     */
    private String validityEndDate;

    /**
     * 准入状态(0正常1未审核2审核中3过期4停用)
     */
    private Integer entryState;

    /**
     * 申请时间
     */
    private Date applyTime;

    /**
     * 申请人ID
     */
    private String applyUserId;

    /**
     * 申请人
     */
    private String applyUser;

    /**
     * 准入时间
     */
    private Date entryTime;

    /**
     * 是否暂停采购(0否1是)
     */
    private Boolean stopFlag;


    public enum ColName {
        entry_id, supplier_code, supplier_type, validity_end_date, entry_state, apply_time, apply_user_id, apply_user, entry_time, stop_flag, 
    }
}
